package com.xbxkj.fegin.Hystrix;

import com.xbxkj.fegin.bean.Evaluate;
import com.xbxkj.fegin.cilent.EvaluateFegin;
import com.xbxkj.util.Respons.ResponseUtil;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @author 张子艺
 * @packge com.xbxkj.fegin.Hystrix
 * @data 2019-07-17 16:37
 * @project MyCloud
 */
@Component
public class EvaluateFeginHystrix implements FallbackFactory<EvaluateFegin> {

    @Override
    public EvaluateFegin create(Throwable throwable) {
        return new EvaluateFegin() {
            @Override
            public Map list() {
                return ResponseUtil.getExceptionMap();
            }
        };
    }
}
